<?php

class Manage_Admin_Navigation_Item_Add extends Action {

  public function doGet($args) {
    
  }

  public function doPost($args) {
    $data = array(
        'label' => $_POST['label'],
        'uri' => $_POST['uri'],
    );
    $nav_id =  (int)$this->getParam('nav');
    $parent_id = (int) $this->getParam('parent');
    $prev_id = (int) $this->getParam('prev');
    $ds =  new Manage_DataService_Navigation();
    $ds->addNode($data, $nav_id, $prev_id, $parent_id);
    Url::redirect('admin/manage/navigation', array('item'=>$nav_id));
  }
}